1. Field of the Invention
The present invention relates to an image processing apparatus suitable for measuring a position (depth) of a given point with respect to a reference point on a three-dimensional object based on a parallax of two stereoscopic images of the three-dimensional object.
2. Description of the Related Art
A method of measuring, e.g., a distance (depth or height) of point P2 in a z-axis with respect to point P1 of a three-dimensional object shown in FIG. 1 using two stereoscopic images is disclosed in "Johoshori Gakkaishi Vol. 22, No. 9, pp. 846-847 issued on September, 1981. This method of measuring the distance will be briefly described below. First, two images (stereoscopic images) when a three-dimensional object to be measured is viewed from different angles are obtained. For example, when the three-dimensional object shown in FIG. 1 is viewed from one direction, an image shown in FIG. 2A is obtained. When the object is viewed from another direction, an image shown in FIG. 2B is obtained. Then, corresponding points on two stereoscopic images are obtained. A distance from a reference point to a given point on the three-dimensional object is calculated based on a deviation (parallax) of positions of the corresponding points on the images.
The corresponding points on the two stereoscopic images are obtained by the following conventional method. That is, assume that one of the two stereoscopic images is given as a reference image. The similarity between images around a given pixel on the reference image and images around each pixel in a search area of the other image is calculated. A pixel providing the maximum similarity within the search area is determined as a pixel corresponding to the given pixel of the reference image.
With the above method, when the distances to a large number of points on an object are calculated, a large number of calculations must be performed in order to detect corresponding points on two stereoscopic images and to calculate a deviation of positions of the corresponding points on the images, resulting in time-consuming. In a conventional image processing apparatus, it takes a very long time to calculate distances to a large number of points on an object.